package com.ruibang.glass.material.constant;

/**
 * @author 宋锦康
 */
public enum MaterialErrorCode {

    QUERY_CONTENT_DATA_IS_FAILED(100080001, "未查询到该A型架与水平托盘容器数据"),
    CONTENT_IS_NOT_BIND_LOT(100080002, "MOM系统A型架与水平托盘容器%s的未绑定批次"),
    CONTENT_LEVEL_IS_ERROR(100080003, "MOM系统A型架与水平托盘容器level品级异常,id=%s"),
    CURRENT_CONTAINER_IS_USE(100080004, "当前容器正在使用中，不可删除！"),
    CONTAINER_CODE_IS_EXIST(100080005, "容器编号已存在请重新数据！"),
    CONTAINER_NOT_FOUND(100080006, "未根据容器ID查询到容器,转移失败！"),
    BUCKET_NOT_FOUNT(100080007, "未查询到料罐,%s失败！"),
    CURRENT_BUCKET_IS_USE(100080008, "当前料罐正在使用中，不可修改状态！"),
    CURRENT_BUCKET_NOT_EMPTY(100080008, "当前料罐已有混料，不可装料！"),
    UNLOAD_RECORD_SAVE_FAIL(100080009, "装货记录保存失败，无法装料，请联系管理员！"),
    BUCKET_IS_NOT_USE(100080010, "当前料罐未启用，无法%s！"),
    SAVE_CONTAINER_FAIL(100080011, "新增容器失败，请联系管理员！"),
    CONTAINER_CODE_REPEAT(100080012, "容器编号重复，请重新输入！"),
    GLASS_UNCHECKED_MAX_SERIAL_NUMBER(100080013, "当前解绑玻璃顺序号不包含最大顺序号，请勾选最大顺序号后解绑"),
    ABNORMAL_CAUSE_NOT_EMPTY(100080014, "异常原因不可为空！"),
    WAREHOUSE_OR_POSITION_IS_NULL(100080015, "获取仓库库位信息为空！"),
    NO_DELETE_RQ_STATUS(100080016, "容器状态已被绑定 暂时无法删除！"),
    WAREHOUSE_ID_SAME(100080017, "调出仓库和调入仓库相同！请检查表单"),
    CHECK_WAREHOUSE_OUT(100080019, "该厂库正在进行盘点！请在盘点结束后在进行出库操作"),
    ALLOCATION_NO_PRODUCT(100080018, "调拨时物品数据为空"),
    MORE_ONE_MATERIAL_CODE(100080019, "物料编码已经存在，请更换新的物料编码"),
    SAME_ITEM_SAME_STORAGE(100080021, "您选择了相同的物品，和相同的库位！请更换物品或库位"),
    EXPORT_FAILD_ONLYTITLE(100080022, "物料导入数据为空请检查表格"),
    EXPORT_FAILD_NO_UNIT(100080025, "物料导入失败！单位为空！请检查表格"),
    EXPORT_FAILD_DICT_NO_UNIT(100080028, "物料导入失败！字典表关于"),
    AVAILABLE_LESS_FROZEN_QUANTITY(100080023, "可用数量小于出库数量！请检查出库数量"),
    MATERIAL_INFORMATION_IS_EXIST(100080024, "物料已经存在，请确认!");
    private int code;
    private String msg;

    MaterialErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

    public static String getValue(int code) {
        for (MaterialErrorCode ele : values()) {
            if (ele.getCode() == code) return ele.getMsg();
        }
        return null;
    }
}
